package p.lodz.pl.poid.zad2.view;

import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.AnchorPane;
import p.lodz.pl.poid.zad2.Loader;
import p.lodz.pl.poid.zad2.controller.SegmentationPanelController;

/**
 * FXML Controller class
 *
 * @author janiu
 */
public class SegmentationPanel extends AnchorPane {

    private final String UI_DEFINITION = "resources/SegmentationPanel.fxml";
    private final SegmentationPanelController controller;

    @SuppressWarnings({"LeakingThisInConstructor", "null"})
    public SegmentationPanel() {
        Loader loader = null;
        try {
            loader = new Loader(UI_DEFINITION, this);
        } catch (IOException ex) {
            Logger.getLogger(SegmentationPanel.class.getName()).log(Level.SEVERE, null, ex);
        }
        controller = loader.getController();
    }

    public void setResultImage(ImageView resultImage) {
        controller.setResultImage(resultImage);
    }

    public void setImage(Image image) {
        controller.setImage(image);
    }
    
    public void setBufferedImage(BufferedImage bufferedImage) {
        controller.setBufferedImage(bufferedImage);
    }
}
